; COMMAND-LINE: --full-saturate-quant
; DISABLE-TESTER: alf
(set-logic AUFLIA)
(set-info :source | Assertion verification of simple set manipulation programs. |)
(set-info :smt-lib-version 2.6)
(set-info :category "crafted")
(set-info :status unsat)
(declare-sort Set 0)
(declare-fun set.member (Int Set) Bool)
(declare-fun set.insert (Set Int) Set)
(declare-fun delete (Set Int) Set)
(declare-fun sup (Set) Int)
(assert (forall ((?x Int) (?s Set)) (set.member ?x (set.insert ?s ?x))))
(assert (forall ((?x Int) (?y Int) (?s Set)) (=> (not (= ?x ?y)) (= (set.member ?x (set.insert ?s ?y)) (set.member ?x ?s)))))
(assert (forall ((?x Int) (?s Set)) (=> (not (set.member ?x ?s)) (= (delete ?s ?x) ?s))))
(assert (forall ((?x Int) (?s Set)) (= (delete (set.insert ?s ?x) ?x) (delete ?s ?x))))
(assert (forall ((?x Int) (?y Int) (?s Set)) (=> (not (= ?x ?y)) (= (delete (set.insert ?s ?y) ?x) (set.insert (delete ?s ?x) ?y)))))
(assert (forall ((?s Set)) (set.member (sup ?s) ?s)))
(assert (forall ((?s Set) (?x Int)) (=> (set.member ?x ?s) (<= ?x (sup ?s)))))
(assert (forall ((?s Set) (?x Int)) (=> (< (sup ?s) ?x) (= (sup (set.insert ?s ?x)) ?x))))
(declare-fun arr () (Array Int Int))
(declare-fun s0 () Set)
(assert (forall ((?i Int)) (=> (> ?i 0) (< (select arr ?i) (sup s0)))))
(declare-fun i1 () Int)
(declare-fun s1 () Set)
(declare-fun g (Int) Int)
(assert (forall ((?i Int)) (> (g ?i) 0)))
(assert (= s1 (set.insert s0 (select arr (g i1)))))
(assert (not (= (sup s1) (sup s0))))
(check-sat)
(exit)
